from fastapi import APIRouter, Depends

from forward.api.admin.schemas.lucky.activity import (
    ActivityAddInSchema,
    ActivityCancleInSchema,
    ActivityDeleteInSchema,
    ActivityDetailInSchema,
    ActivityEditInSchema,
    ActivityListInSchema,
    ActivityStatusInSchema,
)
from forward.api.admin.service.lucky.activity import ActivityService

activity = APIRouter(prefix="/activity")


@activity.post("/lists")
async def list(
    list_in: ActivityListInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.lists(list_in)


@activity.post("/add")
async def add(
    add_in: ActivityAddInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.add(add_in)


@activity.post("/delete")
async def delete(
    delete_in: ActivityDeleteInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.delete(delete_in)


@activity.post("/detail")
async def detail(
    detail_in: ActivityDetailInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.detail(detail_in)


@activity.post("/edit")
async def edit(
    edit_in: ActivityEditInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.edit(edit_in)


@activity.post("/status")
async def status(
    status_in: ActivityStatusInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.status(status_in)


@activity.post("/invalidate_activity")
async def invalidate_activity(
    cancle_in: ActivityCancleInSchema, activity_service: ActivityService = Depends()
):
    return await activity_service.invalidate_activity(cancle_in.activity_id)
